home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / KOOB / common / client / canvas.cs < prev    next >
Text File  |  2005-11-23  |  2KB  |  66 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Function to construct and initialize the default canvas window
  8. // used by the games
  9.  
  10. function initCanvas(%windowName, %effectCanvas)
  11. {
  12.    videoSetGammaCorrection($pref::OpenGL::gammaCorrection);
  13.    
  14.    if( %effectCanvas )
  15.       %canvasCreate = createEffectCanvas( %windowName );
  16.    else
  17.       %canvasCreate = createCanvas( %windowName );
  18.    
  19.    if( !%canvasCreate ) 
  20.    {
  21.       quitWithErrorMessage("Copy of Torque is already running; exiting.");
  22.       return;
  23.    }
  24.  
  25.    setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint );
  26.    setOpenGLAnisotropy( $pref::OpenGL::textureAnisotropy );
  27.    setOpenGLMipReduction( $pref::OpenGL::mipReduction );
  28.    setOpenGLInteriorMipReduction( $pref::OpenGL::interiorMipReduction );
  29.    setOpenGLSkyMipReduction( $pref::OpenGL::skyMipReduction );
  30.  
  31.    // Declare default GUI Profiles.
  32.    exec("~/ui/defaultProfiles.cs");
  33.  
  34.    // Common GUI's
  35.    exec("~/ui/ConsoleDlg.gui");
  36.    exec("~/ui/LoadFileDlg.gui");
  37.    exec("~/ui/ColorPickerDlg.gui");
  38.    exec("~/ui/SaveFileDlg.gui");
  39.    exec("~/ui/MessageBoxOkDlg.gui");
  40.    exec("~/ui/MessageBoxYesNoDlg.gui");
  41.    exec("~/ui/MessageBoxOKCancelDlg.gui");
  42.    exec("~/ui/MessagePopupDlg.gui");
  43.    exec("~/ui/HelpDlg.gui");
  44.    exec("~/ui/RecordingsDlg.gui");
  45.    exec("~/ui/NetGraphGui.gui");
  46.    
  47.    // Commonly used helper scripts
  48.    exec("./metrics.cs");
  49.    exec("./messageBox.cs");
  50.    exec("./screenshot.cs");
  51.    exec("./cursor.cs");
  52.    exec("./help.cs");
  53.    exec("./recordings.cs");
  54.  
  55.    // Init the audio system
  56.    OpenALInit();
  57. }
  58.  
  59. function resetCanvas()
  60. {
  61.    if (isObject(Canvas))
  62.    {
  63.       Canvas.repaint(); 
  64.    }
  65. }
  66.